import {ITableCellStyle} from "@/pages/SelfQuery/type";

export function textAlignAdapter(justifyContent: ITableCellStyle['justifyContent']) {
  switch (justifyContent) {
    case 'flex-start':
      return 'left'
    case 'center':
      return 'center'
    case 'flex-end':
      return 'right'
    default:
      return 'inherit'
  }
}

export const PIVOT_DEFAULT_FONT_COLOR = '#666'
export const PIVOT_CHART_FONT_WEIGHTS = ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900']
export const DEFAULT_FONT_STYLE = 'normal'
export const PIVOT_CHART_FONT_FAMILIES = [
  {name: '苹方', value: 'PingFang SC'},
  {name: '微软雅黑', value: 'Microsoft YaHei'},
  {name: '宋体', value: 'SimSun'},
  {name: '黑体', value: 'SimHei'},
  {name: 'Helvetica Neue', value: '"Helvetica Neue"'},
  {name: 'Helvetica', value: 'Helvetica'},
  {name: 'Arial', value: 'Arial'},
  {name: 'sans-serif', value: 'sans-serif'}
]

export const DefaultTableCellStyle: ITableCellStyle = {
  fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  fontWeight: PIVOT_CHART_FONT_WEIGHTS[0],
  fontColor: PIVOT_DEFAULT_FONT_COLOR,
  fontStyle: DEFAULT_FONT_STYLE,
  justifyContent: 'flex-start'
}
